package com.nbsaas.boot.tech.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import com.nbsaas.boot.user.data.entity.UserInfo;
import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "技术管理", model = "技术", menu = "1,57,70")
@Entity
@Table(name = "bs_technology")
public class Technology extends AbstractEntity {


    @SearchItem(label = "产品名称", name = "name")
    @FormField(title = "名称", sortNum = "2", grid = true, width = "200", col = 22, required = true)
    private String name;

    @FormField(title = "图片", sortNum = "2", grid = true, col = 22, type = InputType.image)
    private String logo;

    @FormField(title = "技术介绍", sortNum = "2", grid = true, col = 22)
    private String introduce;

    @FormField(title = "排序号", sortNum = "2", grid = true, col = 22, sort = true, type = InputType.el_input_number)
    private Integer sortNum;

    @FormField(title = "创建人", sortNum = "2", col = 22, grid = true, ignore = true)
    @FieldConvert
    @FieldName
    @ManyToOne(fetch = FetchType.LAZY)
    private UserInfo creator;

    @FormField(title = "详细介绍", sortNum = "2", type = InputType.richText, col = 22)
    private String note;
}
